package com.bawei.module_mine.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.bawei.module_mine.audit.fragment.AllAuditFragment
import com.bawei.module_mine.audit.fragment.CarAuditFragment
import com.bawei.module_mine.audit.fragment.NewsAuditFragment
import com.bawei.module_mine.audit.fragment.VisitAuditFragment

class AuditFragmentAdapter (fragmentActivity: FragmentActivity) :
    FragmentStateAdapter(fragmentActivity) {

    // 定义要显示的 Fragment 列表
    private val fragmentList = listOf(
        AllAuditFragment(),
        CarAuditFragment(),
        VisitAuditFragment(),
        NewsAuditFragment()
    )

    // 页面标题（对应 TabLayout 的标签文本）
    val fragmentTitleList = listOf(
        "全部",
        "车位审核",
        "来访审核",
        "新闻审核"
    )

    override fun getItemCount(): Int = fragmentList.size

    override fun createFragment(position: Int): Fragment = fragmentList[position]
}